#include "communityui.h"
#include "ui_communityui.h"
#include <QCloseEvent>

CommunityUI::CommunityUI(QWidget *parent) :
    GuiWindow(parent),
    ui(new Ui::CommunityUI)
{
    ui->setupUi(this);
    connect(ui->connectBtn, SIGNAL(clicked()), this, SIGNAL(connectManual()));

}

CommunityUI::~CommunityUI()
{
    delete ui;
}

void CommunityUI::changeEvent(QEvent *e)
{
    QWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void CommunityUI::setPassword(const QString& pass)
{
    ui->password->setText(pass);
}

QString CommunityUI::password()
{
    return ui->password->text();
}

void CommunityUI::setUser(const QString& user)
{
    ui->username->setText(user);
}

QString CommunityUI::user()
{
    return ui->username->text();
}

void CommunityUI::closeEvent(QCloseEvent * event)
{
    event->accept();
}
